package com.bafa.front.events;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.bafa.dbcache.LeagueCache;
import com.bafa.debug.Debug;
import com.bafa.front.presentationbeans.LeagueBean;
import com.bafa.front.presentationbeans.TeamBean;
import com.bafa.front.utils.FrontUtils;
import com.bafa.objects.PageBean;
import com.bafa.services.RetrieveServices;

public class DisplayChangePasswordEvent extends Event {

	@Override
	public void doEvent(HttpServletRequest request,
			HttpServletResponse response, PageBean page) {
		Debug.debug(this.getClass(),"doEvent","Entering .......");
		request.getSession().setAttribute("LOGGEDON",FrontUtils.getUser(request));
		Debug.debug(this.getClass(),"doEvent","USER "+FrontUtils.getUser(request));
		LeagueBean league = (LeagueBean)request.getSession().getAttribute("DIVISION");
		TeamBean team = new TeamBean(RetrieveServices.getTeam(FrontUtils.getUser(request).getTeamId()+""),0);
		request.getSession().setAttribute("LOGGEDONTEAM",team);
	    PageBean pageBeanTemp = RetrieveServices.getPage("displaychangepassword");
	    page.addDetails(pageBeanTemp);
	    page.setPageheader(page.getPageheader().replaceAll("<>", team.getName()));
	    page.setMainheader(page.getMainheader().replaceAll("<>", team.getName()));

	}

}
